<template>
	<view class="container">
		<button class="mini-btn" type="primary" size="mini" @click="onHandleUpdate">检查更新</button>
		<!-- 插件 -->
		<package-version-update ref="updateRef" id="5" :auto="auto" remark="测试更新APP"
			@finish="onHandleFinish"></package-version-update>
	</view>
</template>

<script>
	import PackageVersionUpdate from "@/uni_modules/package-version-update/components/package-version-update/package-version-update.vue";
	export default {
		components: {
			PackageVersionUpdate
		},
		data() {
			return {
				auto: false,
				version: "",
			}
		},
		methods: {
			onHandleUpdate() {
				this.$refs.updateRef.check();
			},
			onHandleFinish(e) {
				uni.showToast({
					title: e.tip
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;

		.mini-btn {
			margin-top: 100rpx;
		}
	}
</style>